class Solution {
    public static void main(String[] args) {
        int ans = Integer.parseInt(args[1]);
        Solution c = new Solution();
        int u = c.fib(Integer.parseInt(args[0]));
        System.out.println(ans);
        System.out.println(u);
        System.out.println(ans==u);
    }

    public int fib(int n) {
        if (n==0) return 0;
        else if ((n==1)||(n==2)) return 1;
        Node root = new Node(0);
        Node r1 = new Node(1);
        Node r2 = new Node(1);
        root.baby = r1;
        r1.baby = r2;
        r2.baby = root;
        Node res = r2;
        final int r = 1000000007;
        n -= 2;
        while (n>0){
            res.baby.value = (res.value+res.baby.baby.value)%r;
            res = res.baby;
            n -= 1;
        }
        return res.value;
    }

    private class Node{
        public int value;
        public Node baby;

        public Node(int v){
            this.value = v;
            this.baby = null;
        }
    }
}